package com.pray.praymall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pray.common.utils.PageUtils;
import com.pray.praymall.order.entity.OrderEntity;
import com.pray.praymall.order.vo.*;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author pray
 * @email pray_cbh@163.com
 * @date 2020-08-29 12:13:07
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 返回订单确认页需要的数据
     * @return 订单确认页数据
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    OrderSubmitResponseVo submitOrder(OrderSubmitVo vo);

    OrderEntity getOrderByOrderSn(String orderSn);

    void closeOrder(OrderEntity entity);

    /**
     * 根据订单号获取订单的支付信息
     * @param orderSn 订单号
     * @return 订单的支付信息
     */
    PayVo getOrderPay(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 处理支付宝的支付结果
     * @param vo
     * @return
     */
    String handlePayResult(PayAsyncVo vo);
}

